import { http } from "@/utils/http";

type ListResult = {
  code: number;
  message: string;
  list: Array<any>;
};

export function getListApi(params?: object): Promise<ListResult> {
  return http.request({
    url: "/list/get",
    method: "get",
    params
  });
}

export function getListApiError(data?: object): Promise<ListResult> {
  return http.request({
    url: "/list/error",
    method: "post",
    data
  });
}

// POST 获取问题分类列表 /api/index/fbtypes
export function fbtypes(data?: object): Promise<{}> {
  return http.request({
    url: "/api/index/fbtypes",
    method: "post",
    data
  });
}
// 获取区域列表 /api/index/countys
export function countys(data?: object): Promise<{}> {
  return http.request({
    url: "/api/index/countys",
    method: "post",
    data
  });
}


// 验证码 /api/common/captcha
export function captcha(params?: object): Promise<{}> {
  return http.request({
    url: "/api/common/captcha",
    method: "get",
    responseType: "blob", // 确保返回二进制 Blob 数据
    params
  });
}


// 提交反馈问题 /api/index/feedback
export function feedback(data?: object): Promise<{}> {
  return http.request({
    url: "/api/index/feedback",
    method: "post",
    data
  });
}

// 查询反馈问题和问题回复 /api/index/getFeedback
export function getFeedback(data?: object): Promise<{}> {
  return http.request({
    url: "/api/index/getFeedback",
    method: "post",
    data
  });
}


